begin

   yy = getenv("yy")

   ;;...................................................... 
   ;; Input files 
   ;;...................................................... 
   fnc = "ar5_mam3_num_a1_elev_2000_c090726.nc"
   fno = "emis_CAM5_monthly_num_a1_"+yy+"_2x2.5.nc"

   flc = addfile(fnc,"r") 

   lat = flc->lat
   lon = flc->lon
   date = flc->date
   altitude = flc->altitude
   altitude_int = flc->altitude_int

   load "date_monthly.ncl" 

   ;;...................................................... 
   ;; output number data 
   ;;...................................................... 

   print("output file : "+fno)
   print(" ")
   print(" ")

   system("rm "+fno)

   flo = addfile(fno,"c")

   va = flc->BC_forestfire
   vb = flc->BC_grassfire
   vc = flc->OC_forestfire
   vd = flc->OC_grassfire
   v3 = flc->SO4_emiss_ene
   v4 = flc->SO4_emiss_ind
   v5 = flc->SO4_contvolc
   v6 = flc->SO4_forestfire
   v7 = flc->SO4_grassfire

   flo->BC_forestfire=va
   flo->BC_grassfire=vb
   flo->OC_forestfire=vc
   flo->OC_grassfire=vd
   flo->SO4_emiss_ene=v3
   flo->SO4_emiss_ind=v4
   flo->SO4_contvolc=v5
   flo->SO4_forestfire=v6
   flo->SO4_grassfire=v7
   flo->lat=lat
   flo->lon=lon
   flo->date=date
   flo->altitude=altitude
   flo->altitude_int=altitude_int

   ;;......................................................
   ;; create global attributes of the file
   ;;......................................................
   fAtt               = True            
   fAtt@Author        = "Kai Zhang (kai.zhang@pnnl.gov)"
   fAtt@Source        = "GFED3.1 fire emission data and CAM5 input files"
   fAtt@creation_date = systemfunc ("date")
   fileattdef( flo, fAtt )


end




